<?php


namespace app\admin\controller;


class App  extends AdminControl
{
    /**
     * Notes:app设置  更新设置
     * User: shen
     * Date: 2020/4/22
     * Time: 21:55
     * @return mixed
     */
    public function index() {
        if (!request()->isPost()) {
            $list_config = rkcache('config', true);
            $this->assign('config',$list_config);
            $this->setAdminCurItem('index');
            return $this->fetch('index');
        }else{
            $update_array=input('param.');
            $result = model('config')->editConfig($update_array);
            if($result){
                return json(['code' => 1, 'url' => url('App/index'), 'msg' => '操作成功']);
            }else{
                return json(['code' => 0, 'url' => url('\'App/index'), 'msg' => '操作失败']);
            }
        }

    }

    /**
     * Notes:app设置  提现设置
     * User: shen
     * Date: 2020/4/24
     * Time: 14:14
     * @return mixed|\think\response\Json
     */
    public function money_radio() {
        if (!request()->isPost()) {
            $list_config = rkcache('config', true);
            $this->assign('config',$list_config);
            $this->setAdminCurItem('money_radio');
            return $this->fetch('money_radio');
        }else{
            $update_array=input('param.');
            $result = model('config')->editConfig($update_array);
            if($result){
                return json(['code' => 1, 'url' => url('App/money_radio'), 'msg' => '操作成功']);
            }else{
                return json(['code' => 0, 'url' => url('App/money_radio'), 'msg' => '操作失败']);
            }
        }

    }

    /**
     * 获取卖家栏目列表,针对控制器下的栏目
     */
    protected function getAdminItemList() {
        $menu_array = array(
            array(
                'name' => 'index',
                'text' => 'app更新设置',
                'url' => url('App/index')
            ),
        );
        return $menu_array;
    }
}